package joc.internal;

import java.util.HashMap;
import java.util.Map;

public class Action {
	private Map<ActionType, Boolean> commands = new HashMap<ActionType, Boolean>();

	public Action() {
		commands.put(ActionType.ASSERT, Boolean.TRUE);
	}

	public void addCommand(Command command) {
		commands.put(command.type, Boolean.valueOf(command.enabled));
	}

	public boolean hasAction(ActionType type) {
		return commands.containsKey(type) ? commands.get(type).booleanValue() : false;
	}

	public static enum Command {
		AssertOn(ActionType.ASSERT, true), AssertOff(ActionType.ASSERT, false), LogOn(ActionType.LOG, true), LogOff(
				ActionType.LOG, false);

		private ActionType type;
		private boolean enabled;

		private Command(ActionType command, boolean enabled) {
			this.type = command;
			this.enabled = enabled;
		}
	}

	public static enum ActionType {
		ASSERT, LOG;
	}
}